package com.jbm.onehome.iface;

import com.jbm.core.iface.IAcross;

import javax.persistence.*;

/**
 * Created by root on 17-9-19.
 */
@Entity
@Table(name = "m_privileges", schema = "", catalog = "")
public class MPrivilegesEntity extends IAcross
{
	private int priId;
	private String priCode;
	private String priName;
	private String priType;
	private int level;
	private int priGrpId;
	private String grpCode;
	private String grpName;
	private String grpType;
	private int grpLevel;

	@Id
	@Basic
	@Column(name = "pri_id", nullable = false)
	public int getPriId()
	{
		return priId;
	}

	public void setPriId(int priId)
	{
		this.priId = priId;
	}

	@Basic
	@Column(name = "pri_code", nullable = false, length = 39)
	public String getPriCode()
	{
		return priCode;
	}

	public void setPriCode(String priCode)
	{
		this.priCode = priCode;
	}

	@Basic
	@Column(name = "pri_name", nullable = true, length = 79)
	public String getPriName()
	{
		return priName;
	}

	public void setPriName(String priName)
	{
		this.priName = priName;
	}

	@Basic
	@Column(name = "pri_type", nullable = true, length = 9)
	public String getPriType()
	{
		return priType;
	}

	public void setPriType(String priType)
	{
		this.priType = priType;
	}

	@Basic
	@Column(name = "level", nullable = false)
	public int getLevel()
	{
		return level;
	}

	public void setLevel(int level)
	{
		this.level = level;
	}

	@Basic
	@Column(name = "pri_grp_id", nullable = false)
	public int getPriGrpId()
	{
		return priGrpId;
	}

	public void setPriGrpId(int priGrpId)
	{
		this.priGrpId = priGrpId;
	}

	@Basic
	@Column(name = "grp_code", nullable = false, length = 39)
	public String getGrpCode()
	{
		return grpCode;
	}

	public void setGrpCode(String grpCode)
	{
		this.grpCode = grpCode;
	}

	@Basic
	@Column(name = "grp_name", nullable = true, length = 79)
	public String getGrpName()
	{
		return grpName;
	}

	public void setGrpName(String grpName)
	{
		this.grpName = grpName;
	}

	@Basic
	@Column(name = "grp_type", nullable = true, length = 9)
	public String getGrpType()
	{
		return grpType;
	}

	public void setGrpType(String grpType)
	{
		this.grpType = grpType;
	}

	@Basic
	@Column(name = "grp_level", nullable = false)
	public int getGrpLevel()
	{
		return grpLevel;
	}

	public void setGrpLevel(int grpLevel)
	{
		this.grpLevel = grpLevel;
	}

	@Override
	public boolean equals(Object o)
	{
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		MPrivilegesEntity that = (MPrivilegesEntity) o;

		if (priId != that.priId) return false;
		if (level != that.level) return false;
		if (priGrpId != that.priGrpId) return false;
		if (grpLevel != that.grpLevel) return false;
		if (priCode != null ? !priCode.equals(that.priCode) : that.priCode != null) return false;
		if (priName != null ? !priName.equals(that.priName) : that.priName != null) return false;
		if (priType != null ? !priType.equals(that.priType) : that.priType != null) return false;
		if (grpCode != null ? !grpCode.equals(that.grpCode) : that.grpCode != null) return false;
		if (grpName != null ? !grpName.equals(that.grpName) : that.grpName != null) return false;
		if (grpType != null ? !grpType.equals(that.grpType) : that.grpType != null) return false;

		return true;
	}

	@Override
	public int hashCode()
	{
		int result = priId;
		result = 31 * result + (priCode != null ? priCode.hashCode() : 0);
		result = 31 * result + (priName != null ? priName.hashCode() : 0);
		result = 31 * result + (priType != null ? priType.hashCode() : 0);
		result = 31 * result + level;
		result = 31 * result + priGrpId;
		result = 31 * result + (grpCode != null ? grpCode.hashCode() : 0);
		result = 31 * result + (grpName != null ? grpName.hashCode() : 0);
		result = 31 * result + (grpType != null ? grpType.hashCode() : 0);
		result = 31 * result + grpLevel;
		return result;
	}
}
